import canvasAbstract from './canvasAbstract';
import config from '../config';
import model from '../model/player'
export default new (class player extends canvasAbstract implements ICanvas{
    num(): number {
        return config.player.num;
    }
    model(): IModelAbstract {
        return model
    }
    render(): void {
        this.createModels()
        super.renderModels()
    }

    protected createModels(): void {
        const cw = config.canvas.width;
        const ch = config.canvas.height;
        const mw = config.model.width;
        const mh = config.model.height;
        [{x: cw / 2 + mw * 4,y: ch - mh}].forEach(position => {
            const model = this.model() as IModelAbstract;
            const instance = new model(position.x,position.y);
            this.models.push(instance);
        });
    }
})('player');